package com.oig.sys.workflow.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 * 自动化监听事件
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_listener_event")
@EntityListeners({AuditingEntityListener.class})
public class TbListenerEvent implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 * 所属监听对象id
	 */
	@Column(name = "object_id")
	private Integer objectId;

	/**
	 * 监听事件名称
	 */
	@Column(name = "listener_event_name")
	private String listenerEventName;

	/**
	 * 对应实体对象id
	 */
	@Column(name = "listener_module_id")
	private Integer listenerModuleId;
	/**
	 * 对应实体对象名
	 */
	@Column(name = "listener_module_name")
	private String listenerModuleName;

	/**
	 * 监听表
	 */
	@Column(name = "listener_table_name")
	private String listenerTableName;

	/**
	 * 对应操作只有枚举  insert update  delete
	 */
	@Column(name = "listener_event_operation")
	private String listenerEventOperation;

	/**
	 * 关联业务单号的字段名
	 */
	@Column(name = "object_id_column")
	private String objectIdColumn;

	/**
	 * 备注说明
	 */
	@Column(name = "remark")
	private String remark;

	/**
	 * 状态 通用状态码
	 */
	@Column(name = "status")
	private String status;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;

}
